﻿using Alos.Common;
using Alos.Entity;
using Alos.IService;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using System.Web;
using System.Web.Http;

namespace Alos.LanClass.Api
{
    /// <summary>
    /// 资源信息获取
    /// </summary>
    public class ResourceController : ApiController
    {
        IReResourceService ReResourceService;
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="_ReResourceService"></param>
        public ResourceController(IReResourceService _ReResourceService)
        {
            ReResourceService = _ReResourceService;
        }
        /// <summary>
        /// 根据资源编号获取资源
        /// </summary>
        /// <param name="ids">以逗号“,”分割的资源编号字符串 例如：“5198,5199,5372”</param>
        /// <returns></returns>
        [HttpGet]
        [Route("api/resource/get")]
        public async Task<JsonRtn<List<dynamic>>> get(string ids)
        {
            var jsRtn = new JsonRtn<List<dynamic>>();
            jsRtn.data = await ReResourceService.GetReResourceById(ids);
            return jsRtn;
        }
    }
}